//
//  OfficialDocumentViewController.m
//  JNT_OA
//
//  Created by 王文晓 on 16/8/5.
//  Copyright © 2016年 王文晓. All rights reserved.
//

#import "OfficialDocumentViewController.h"
#import "UIBarButtonItem+ZTItem.h"

@interface OfficialDocumentViewController ()<MyViewDelget>

@property (nonatomic, strong) UISegmentedControl *segmentedControl;
@end

@implementation OfficialDocumentViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setUpNavgationBar];
    
    NSArray *ar = @[@"待办",@"收文",@"发文"];
    MyView *myView = [[MyView alloc]initWithArr:ar Bol:YES];
    myView.delget = self;
    [self.view addSubview:myView];
    UITableView *tabl = [[UITableView alloc] initWithFrame:kRect(0, 40, kScreenWidth, kScreenHeight-104)];
    [self.view addSubview:tabl];
   
}


-(void)buttonAction:(id)but{
    UIButton* but1 = but;
//    NSLog(@"-- %ld",(long)but1.tag);
    
    if (but1.tag == 1000) {
        
       
    }else if (but1.tag == 1001){
       
    }else if (but1.tag == 1002){
        
    }
}



#pragma mark - 设置导航条
- (void)setUpNavgationBar
{
    self.title = @"公文";
    self.navigationController.interactivePopGestureRecognizer.delegate = (id)self;
    self.navigationController.navigationBar.translucent = NO;
//     self.navigationItem.leftBarButtonItem = [UIBarButtonItem leftBarButtonItemTarget:self action:@selector(leftBtnClick) forControlEvents:UIControlEventValueChanged];
}


//- (void)leftBtnClick
//{
//    [self.navigationController popViewControllerAnimated:YES];
//}






@end

//{
//    UIButton *titleBtn;
//}
#pragma mark ===btn==
//- (void)viewDidLoad {
//    [super viewDidLoad];
//    self.title = @"公文";
//    self.view.backgroundColor  =[UIColor whiteColor];
//    [self.navigationController.navigationBar setTitleTextAttributes:
//     @{NSFontAttributeName:[UIFont systemFontOfSize:19],
//       NSForegroundColorAttributeName:[UIColor whiteColor]}];
//    self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:0.000 green:0.502 blue:1.000 alpha:1.000];
//    NSArray *titleArray = @[@"待办",@"收文",@"发文"];
//
//    for (int i = 0; i< 3; i++) {
//        UIButton * contentBTn = [UIButton buttonWithType:UIButtonTypeCustom];
//        contentBTn.frame = CGRectMake(self.view.bounds.size.width/3*i, 64, self.view.bounds.size.width/3, 40);
//        contentBTn.font = [UIFont systemFontOfSize:14];
//         contentBTn.tag = 100 + i;
//        [contentBTn setTitle:titleArray[i] forState:UIControlStateNormal];
//        [contentBTn addTarget:self action:@selector(buttAction:) forControlEvents:UIControlEventTouchUpInside];
//        if (i == 0) { // 默认展示第一第一注数据
//            [contentBTn setTitleColor:[UIColor colorWithRed:1.000 green:0.800 blue:0.400 alpha:1.000] forState:UIControlStateNormal];
//            titleBtn = contentBTn;
//        }else{
//            [contentBTn setTitleColor:[UIColor colorWithWhite:0.702 alpha:1.000] forState:UIControlStateNormal];
//        }
//        contentBTn.backgroundColor = [UIColor colorWithWhite:0.902 alpha:1.000];
//        [self.view addSubview:contentBTn];
//    }
//    UITableView *tabl = [[UITableView alloc] initWithFrame:CGRectMake(0, 104, self.view.bounds.size.width, self.view.bounds.size.height- 40)];
//    tabl.backgroundColor = [UIColor whiteColor];
//    [self.view addSubview:tabl];
//
//    UIView *linVi1 = [[UIView alloc] initWithFrame:CGRectMake(self.view.bounds.size.width/3, 69, 2, 30)];
//    linVi1.backgroundColor = [UIColor colorWithWhite:0.702 alpha:1.000];
//    [self.view addSubview:linVi1];
//
//    UIView *linVi2 = [[UIView alloc] initWithFrame:CGRectMake(self.view.bounds.size.width/3*2, 69, 2, 30)];
//    linVi2.backgroundColor = [UIColor colorWithWhite:0.702 alpha:1.000];
//    [self.view addSubview:linVi2];
//
//
//
//
//}
//
//-(void)buttAction:(UIButton*)but{
//    NSLog(@"--- %ld",but.tag);
//    [titleBtn setTitleColor:[UIColor colorWithWhite:0.498 alpha:1.000] forState:UIControlStateNormal];
//    [but setTitleColor:[UIColor colorWithRed:1.000 green:0.800 blue:0.400 alpha:1.000] forState:UIControlStateNormal];
//
//    titleBtn = but;
////    在此改变tablewView 展示的数据 刷新tableView
//
//
//}



#pragma mark ==segmentedControl==
////- (void)viewDidLoad {
////    [super viewDidLoad];
////    self.navigationItem.title = @"公文";

//////    [self.view addSubview:self.segmentedControl];
////}
////
////- (void)didReceiveMemoryWarning {
////    [super didReceiveMemoryWarning];
////    // Dispose of any resources that can be recreated.
////}
////
////- (UISegmentedControl *)segmentedControl {
////
////    if (!_segmentedControl) {
////
////        _segmentedControl = [[UISegmentedControl alloc]initWithItems:@[@"视图1",@"视图2",@"视图3"]];
////        _segmentedControl.frame = CGRectMake(0,64, self.view.frame.size.width, 50);
////        _segmentedControl.backgroundColor = [UIColor colorWithWhite:0.702 alpha:1.000];
////        _segmentedControl.tintColor = [UIColor colorWithWhite:0.800 alpha:1.000];
////        [_segmentedControl addTarget:self action:@selector(segmentAction:) forControlEvents:UIControlEventValueChanged];
////        _segmentedControl.selectedSegmentIndex = 0;
////    }
////    return _segmentedControl;
////}
////
//////分段控制器回调方法
////- (void)segmentAction: (UISegmentedControl *)segment{
////
////
//}
